#!/usr/bin/env sh
: "${USERNAME:="default"}"

if ! whoami &> /dev/null; then
  if [ -w /etc/passwd ]; then
    echo "${USERNAME}:x:$(id -u):0:${USERNAME} user:${HOME}:/sbin/nologin" >> /etc/passwd
  fi
fi
exec "$@"